#include <iostream>
#include <stack>
#include <string>
#include <vector>

using namespace std;

struct Op {
    int op_type;
};

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int q;
    cin >> q;

    int a = 0, b = 0;
    vector<int> A(q + 1), B(q + 1);
    int top = 0;
    A[top] = a;
    B[top] = b;

    vector<string> res;
    while (q-- > 0) {
        int op; cin >> op;
        if (op == 1) {
            char c; cin >> c;
            if (c == '(') a++;
            else {
                if (a == 0) b++;
                else a -= 1;
            }
            top++;
            A[top] = a;
            B[top] = b;
        } else {
            top--;
            a = A[top];
            b = B[top];
        }
        if (a == 0 && b == 0) res.push_back("Yes");
        else res.push_back("No");
    }

    for (string s : res) {
        cout << s << "\n";
    }

    return 0;
}